<!DOCTYPE html>
<html>
  <head>
    <title><%= title %></title>
    
    <link rel='stylesheet' href='/stylesheets/style.css' />
    <%- include common  %>
  </head>
  <body>

      <%- include("head",{title:"index"}) %>

      <div class="container-fluid">
        <div class="container">
            <h4 class="text-primary"><%- title %> </h4>

            <%  if(username){  %>
                <div>
                  <p>欢迎你: <b> <%- username %>  /  <%- phone %>  </b></p>
                  <p>登录时间 :   <span class="text-danger">  <%- loginTime %> </span> </p>
                  <p>当前时间 :   <span class="text-warning" id="nowtime">   </span> </p>
                  
                  <button type="button" class="btn btn-primary" onclick="location.href='/movie'" >查看电影</button>
                  <button type="button" class="btn btn-danger" onclick="location.href='/logout'" >注销</button>
                  
                </div>
            <%  }else{  %>
              <button type="button" class="btn btn-success" onclick="location.href='/login'">登录 </button>
              <button type="button" class="btn btn-info"  onclick="location.href='/register'" >注册</button>
                
            <%  }   %>
        
        </div>
      </div>
     

    <%- include foot %>

    <script>
        window.onload = function(){
            
          $("#nowtime").html(moment().format("YYYY-MM-DD HH:mm:ss") )
          var timer = setInterval(()=>{
            $("#nowtime").html(moment().format("YYYY-MM-DD HH:mm:ss") )
          },1000) 
        }
    </script>
  </body>
</html>
